﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${ctx}/component/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<title>查询方法调用时间表列表</title>
<%@ include file="/include/header.jsp"%>
</head>
<body>
	<div class="wrap">

		<div class="main_panel">
			<div class="ch_panel" id="queryDiv">
				<input type="hidden" data-qname="currentPage" value="1" />
				<table class="c_table m_t10" border="0">
					<tr>
						<td align="left">
							访问用户 :
							<input type="text" data-qname="createUser" value="" class="input_txt" style="width: 120px;" />
							&nbsp;&nbsp; 级别 : <select id="grade" data-qname="grade" style="width: 100px;">
								<option value="">--请选择--</option>
								<c:forEach items="${gradeMap}" var="var">
									<option value="${var.key }">${var.key}</option>
								</c:forEach>
							</select>&nbsp;&nbsp; 操作时间:
							<input type="text" data-qname="beginTime" class="input_txt" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" style="width: 120px" />
							/
							<input type="text" data-qname="endTime" class="input_txt" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" class="input_txt" style="width: 120px" />
							&nbsp;&nbsp;
						</td>
						<td>
							<input type="button" value="查询" id="searchBtn" class="c_btn" />
						</td>
					</tr>
				</table>
			</div>

			<!-- tab -->
			<!-- 列表 -->
			<div id="pro_2" class="pro_box ">
				<table id="tbwrap" class="table table-border table-bordered table-bg m_t10 hovaertable"></table>
				<div class="page eui-pager-custom" id="j_pager"></div>
			</div>
		</div>

		<script type="text/html" id="tb_template">
		<thead>
			<tr>
				<th>访问地址</th>
				<th>耗时（毫秒）</th>
				<th>级别</th>
				<th>系统名称</th>
				<th>访问用户</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody data-type="body">
			<!if(list.length>0) { !>
				<!for(var i=0,len=list.length;i<len;i++){
					var item = list[i],classItem = (i%2!=0)?"odd td_odd":"even";
				!>
				<tr class="gradeA <!=classItem!>">
					<td title="<!=item["uri"]!>"><!=item["uri"]!></td>
					<td title="<!=item["timeConsuming"]!>"><!=item["timeConsuming"]!></td>
					<td title="<!=item["gradeName"]!>"><!=item["grade"]!></td>
					<td title="<!=item["sysName"]!>"><!=item["sysName"]!></td>
					<td title="<!=item["createUser"]!>"><!=item["createUser"]!></td>
					<td title="<!=item["createTime"]!>"><!=item["createTime"]!></td>
					<td>
						<a title="详情" data-value="<!=item["uuid"]!>" class="view" style="text-decoration: none;margin-right: 10px;">
							<i class="Hui-iconfont">&#xe665;</i>
						</a>
					</td>
				</tr>
			<!}!>
			<!}else{!>
				<tr>
					<td colspan="10"> 暂无数据</td>
				</tr>
			<!}!>
		</tbody>
	</script>



		<script type="text/javascript">
		var sysMethodCallTimeDialog;
		$(function() {

			// 1、详细
			$("#tbwrap").delegate(".view", "click", function() {
				//获取主键
				var uuid = $(this).data("value");
				parent.member_add("查看方法调用时间详细信息", "${ctx}/sysMethodCallTime/view?uuid="+uuid,700,350);
			});
			
			// 2、查询
			$("#searchBtn").click(function() {
				search();
			});
			
			// 页面加载完成调用查询分页
			search();
		});
	</script>

		<script type="text/javascript">
		function search() {
			// 这里放包含查询条件的DIV
			var paramData = easyUtils.getQueryDivDefault("queryDiv");
			
			seajs.use([ "component/table" ], function(uiTable) {
				var param = {
					url : "${ctx}/sysMethodCallTime/ajaxPage",
					data : paramData
				};
				easyUtils.getData(param, function(result) {
					easyUtils.buildTable(result, param, uiTable);
					if(result.dataList.length>0){	
						easyUtils.fullRows("queryTable",8);
					}
				});
			});
		}
	</script>
		<%@ include file="/include/footer.jsp"%>
</body>
</html>
